﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using kmer.Helper;

namespace kmer.Web.Helper {
	public static class ResponseHelper {
		public static void WriteLine(this System.Web.HttpResponse Response, string s) {
			Response.Write(s);
			Response.Write("\n");
		}
		public static void WriteLine(this System.Web.HttpResponse Response) {
			Response.Write("\n");
		}
		public static void WriteLine(this System.Web.HttpResponse Response, object obj, bool json = false){
			if (obj == null) {
				ResponseHelper.WriteLine(Response, "Value is NULL");
			}
			ResponseHelper.WriteLine(Response, json ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : obj.ToString());
		}
	}
}
